/*
 * Copyright (c) 2012 Universidad Antonio de Nebrija.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Apache License v2.0
 * which accompanies this distribution, and is available at
 * http://www.apache.org/licenses/LICENSE-2.0.html
 * 
 * Contributors:
 *    Universidad Antonio de Nebrija - initial API, implementation and documentation
 */
package com.nebrija.riif.model;

import java.util.Locale;

/**
 * Class representing a combination of value and units
 * @author asanchep
 *
 */
public class ValueUnit {
	private double value;
	private String unit;
	
	/**
	 * Creates a ValueUnit object
	 * @param value the value
	 * @param unit the units in which the value is measured
	 */
	public ValueUnit(double value, String unit){
		this.setValue(value);
		this.setUnit(unit);
	}

	public double getValue() {
		return value;
	}

	public void setValue(double value) {
		this.value = value;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("vu=");
		return sb.append(String.format(Locale.US,"%f",value)).append(unit).toString();
	}
	
	
}
